package com.sx.controller;

import java.sql.SQLException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.annotation.BaseSeverlet;
import com.annotation.MethodAnnotation;
import com.dfec.utils.ResultHandler;
import com.sx.service.LifeIndexAirService;

/**
 * 生活指数和空气质量
 * Servlet implementation class WeatherKnow
 */
@WebServlet(name = "la", description = "生活指数和空气质量", urlPatterns = { "/la" })
public class LifeIndexAQIController extends BaseSeverlet {
	private static final long serialVersionUID = 1L;
	LifeIndexAirService  ws=null;
    public LifeIndexAQIController() {
        super();
        // TODO Auto-generated constructor stub
        ws=new LifeIndexAirService();
    }
    /**
     * 
     * @param request
     * @param response
     */
    @MethodAnnotation(method="lifeList")
    public void lifeList(HttpServletRequest request, HttpServletResponse response){
    	try {
			ResultHandler.handler(request, response, ws.lifeList(request),true);
		} catch (SQLException e) {
			e.printStackTrace();
		}
        	
            
    }
    /**
     * 全省的排名和aqi指数
     * @param request
     * @param response
     */
    @MethodAnnotation(method="orderList")
    public void airList(HttpServletRequest request, HttpServletResponse response){
        	try {
				ResultHandler.handler(request, response, ws.orderList(request),true);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            
    }
    
    
    /**
     * 空气质量小时趋势
     * @param request
     * @param response
     */
    @MethodAnnotation(method="trendList")
    public void orderList(HttpServletRequest request, HttpServletResponse response) {
    	try {
			ResultHandler.handler(request, response, ws.airTrendList(request),true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
            
    }
    

    
    /**
     * 空气质量详情
     * @param request
     * @param response
     */
    @MethodAnnotation(method="airDetails")
    public void airDetails(HttpServletRequest request, HttpServletResponse response) {
    	try {
			ResultHandler.handler(request, response, ws.airDetails(request),true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
            
    }
    
    
    
    
    
    
    
    
    /**
     * 本市各点排名和aqi指数
     * @param request
     * @param response
     */
    @MethodAnnotation(method="corderList")
    public void corderList(HttpServletRequest request, HttpServletResponse response){
        	try {
				ResultHandler.handler(request, response, ws.corderList(request),true);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            
    }
    
    
    /**
     * 本市各检测点空气质量小时趋势
     * @param request
     * @param response
     */
    @MethodAnnotation(method="ctrendList")
    public void ctrendList(HttpServletRequest request, HttpServletResponse response) {
    	try {
			ResultHandler.handler(request, response, ws.cairTrendList(request),true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
            
    }
    

    
    /**
     * 检测点空气质量详情
     * @param request
     * @param response
     */
    @MethodAnnotation(method="cairDetails")
    public void cairDetails(HttpServletRequest request, HttpServletResponse response) {
    	try {
			ResultHandler.handler(request, response, ws.cairDetails(request),true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
            
    }
    
}
